#ifndef __MUTEX_H_INCLUDED__
#define __MUTEX_H_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

namespace std{

class mutex{

public:

	mutex(){
		pthread_mutex_init(&m, 0);
	}

	void lock(){
		pthread_mutex_lock(&m);
	}

	void unlock(){
		pthread_mutex_unlock(&m);
	}

	~mutex(){
		pthread_mutex_destroy(&m);
	}

private:

	pthread_mutex_t m;
};

};

#ifdef __cplusplus
}
#endif

#endif // __MUTEX_H_INCLUDED__
